module manager {

    export class SystemManager {
        public static info: SystemInfo;

        public static canvasWidth: number = 0;
        public static canvasHeight: number = 0;

        public static init(): void {
            if (GameManager.isProduct) {
                SystemManager.info = wx.getSystemInfoSync();
            }
        }

        public static resetCanvas():void {
            let canvas = window["sharedCanvas"];
            canvas.width = SystemManager.canvasWidth;
            canvas.height = SystemManager.canvasHeight;
        }

        public static getSharedCanvas(): any {
            console.log('getSharedCanvasgetSharedCanvas')
            let canvas = window["sharedCanvas"];
            if (SystemManager.canvasWidth < 1 || SystemManager.canvasHeight < 1) {
                SystemManager.canvasWidth = canvas.width;
                SystemManager.canvasHeight = canvas.height;
            }
            return canvas;
        }

        public static getGameCanvas(): any {
            let canvas = window["canvas"];
            return canvas;
        }

    }

}